{include file="public/_meta" /}
<body>
<style>
    .required_b{
        color: red;
    }
</style>
<div class="wrapper">

    {include file="public/_header" /}

    <!-- Sidebar -->
    {include file="public/_menu" /}
    <!-- End Sidebar -->

    <div class="main-panel">

        <div class="content">
            <div class="page-inner">

                <!-- 面包屑 -->
                {include file="public/_page_header" /}

                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="d-flex align-items-center">
                                    <h4 class="card-title">商户列表</h4>
                                    {if condition="!in_array($group_id,[4])"}
<!--                                    <button type="button" title="批量设置定时投放" class="btn btn-primary layui-btn ml-auto" data-toggle="modal" data-target="#addRowModal4">-->
<!--                                        <i class="fas fa-calendar-alt"></i>批量设置定时投放-->
<!--                                    </button>-->
<!--                                    <button type="button" title="批量设置投放时段" class="btn btn-primary layui-btn ml-auto" data-toggle="modal" data-target="#addRowModal6">-->
<!--                                        <i class="fas fa-calendar-alt"></i>批量设置投放时段-->
<!--                                    </button>-->
                                    <button type="button" title="批量开启" class="btn btn-primary layui-btn " onClick="change_status(1)">
                                        批量开启
                                    </button>
                                    <button type="button" title="批量关闭" class="btn btn-primary layui-btn " onClick="change_status(2)">
                                        批量关闭
                                    </button>
                                    <button class="btn btn-primary btn-round ml-auto" data-toggle="modal" data-target="#addRowModal" onClick="add_item(0)">
                                        <i class="fa fa-plus"></i>
                                        添加
                                    </button>
                                    {/if}
                                </div>

                                <form class="row">

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <select class="form-control" name="status">
                                                <option value="0">全部状态</option>
                                                <option value="1" {if condition="1 eq $status"}selected{/if}>启用</option>
                                                <option value="2" {if condition="2 eq $status"}selected{/if}>禁用</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <select class="form-control" name="weihu">
                                                <option value="">维护人</option>
                                                {volist name="infoTemp" id="vo"}
                                                <option value="{$vo.uid}">【{$vo.realname}】【账号{$vo.phone}】</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>


                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="mer_name" value="{$mer_name}" placeholder="请输入商户名称">
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="phone" value="{$phone}" placeholder="请输入电话">
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="username" value="{$username}" placeholder="请输入账号">
                                        </div>
                                    </div>

                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">

                                            <select class="form-control input-full" name="orderb" id="orderb">
                                                <option value="0">余额排序</option>
                                                <option value="1" {if condition="$orderb eq 1"}selected{/if}>余额升序</option>
                                                <option value="2" {if condition="$orderb eq 2"}selected{/if}>余额降序</option>
                                            </select>
                                        </div>
                                    </div>



                                    <div class="col-md-6 col-lg-2">
                                        <div class="form-group">
                                            <button type="submit" class="btn btn-primary">查询</button>
                                            <a href="{:url('merchant/index')}" class="btn btn-info" style="color: white;position: absolute;left: 110px;">重置</a>
                                        </div>
                                    </div>

                                </form>

                            </div>


                            <div class="card-body">
                                <!-- Modal -->
                                <div class="modal fade" id="addRowModal" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">添加</span>

                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal">
                                                    <div class="row">


                                                        <!--<div class="form-group form-inline col-md-12" id="system_div">
                                                            <label for="bind_aid" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">系统</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <select class="form-control input-full" name="push_system_type" id="system">
                                                                    <option value="0">--请选择--</option>
                                                                    {volist name="stsyem" id="vo" key="k"}
                                                                    <option value="{$k}">{$vo}</option>
                                                                    {/volist}
                                                                </select>
                                                            </div>
                                                        </div>-->

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="username" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">账号<b class="required_b">*</b></font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="username" name="username" placeholder="登录账号">
                                                            </div>
                                                        </div>
                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="password" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">密码<b class="required_b">*</b></font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="password" name="password" placeholder="登录密码">
                                                            </div>
                                                        </div>


                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="mer_name" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">商户名称 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="mer_name" name="mer_name" placeholder="商户名称">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="mer_desc" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">商户简称</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="mer_desc" name="mer_desc" placeholder="商户简称">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="contacts" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">联系人</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="contacts" name="contacts" placeholder="联系人">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="phone" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">手机号</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="phone" name="phone" placeholder="手机号">
                                                            </div>
                                                        </div>

<!--                                                        <div class="form-group form-inline col-md-12">-->
<!--                                                            <label for="email" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">邮箱</font></label>-->
<!--                                                            <div class="col-md-8 p-0">-->
<!--                                                                <input type="text" class="form-control input-full" id="email" name="email" placeholder="邮箱">-->
<!--                                                            </div>-->
<!--                                                        </div>-->

<!--                                                        <div class="form-group form-inline col-md-12">-->
<!--                                                            <label for="web_url" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">官网</font></label>-->
<!--                                                            <div class="col-md-8 p-0">-->
<!--                                                                <input type="text" class="form-control input-full" id="web_url" name="web_url" placeholder="官网">-->
<!--                                                            </div>-->
<!--                                                        </div>-->

<!--                                                        <div class="form-group form-inline col-md-12">-->
<!--                                                            <label for="unify_code" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">统一社会信用代码</font></label>-->
<!--                                                            <div class="col-md-8 p-0">-->
<!--                                                                <input type="text" class="form-control input-full" id="unify_code" name="unify_code" placeholder="统一社会信用代码">-->
<!--                                                            </div>-->
<!--                                                        </div>-->

<!--                                                        <div class="form-group form-inline col-md-12">-->
<!--                                                            <label for="address" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">注册地址</font></label>-->
<!--                                                            <div class="col-md-8 p-0">-->
<!--                                                                <input type="text" class="form-control input-full" id="address" name="address" placeholder="注册地址">-->
<!--                                                            </div>-->
<!--                                                        </div>-->

                                                        {if condition="!in_array($group_id,[4,5])"}
                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="bind_aid" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">引入人</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <select class="form-control input-full" name="bind_aid" id="bind_aid">
                                                                    <option value="0">--请选择--</option>
                                                                    {volist name="infoTemp" id="vo"}
                                                                    <option value="{$vo.uid}">【{$vo.realname}】【账号{$vo.phone}】</option>
                                                                    {/volist}
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="weihu_aid" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">维护人</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <select class="form-control input-full" name="weihu_aid" id="weihu_aid">
                                                                    <option value="0">--请选择--</option>
                                                                    {volist name="infoTemp" id="vo"}
                                                                    <option value="{$vo.uid}">【{$vo.realname}】【账号{$vo.phone}】</option>
                                                                    {/volist}
                                                                </select>
                                                            </div>
                                                        </div>
                                                        {/if}

<!--                                                        <div class="form-group form-inline col-md-12">-->
<!--                                                            <label for="address" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">维护人</font></label>-->
<!--                                                            <div class="col-md-8 p-0">-->
<!--                                                                <input type="text" class="form-control input-full" id="weihu_user" name="weihu_user" placeholder="维护人">-->
<!--                                                            </div>-->
<!--                                                        </div>-->


<!--                                                        <div class="form-check form-inline col-md-12">-->
<!--                                                            <div class="col-md-8 p-0">-->
<!--                                                                <div class="form-check">-->
<!--                                                                    <label class="col-md-3 col-form-label"><font style="vertical-align: inherit;">状态</font></label>-->
<!--                                                                    <label class="form-radio-label">-->
<!--                                                                        <input class="form-radio-input" type="radio" name="status" value="1" checked="">-->
<!--                                                                        <span class="form-radio-sign">启用</span>-->
<!--                                                                    </label>-->
<!--                                                                    <label class="form-radio-label ml-3">-->
<!--                                                                        <input class="form-radio-input" type="radio" name="status" value="2">-->
<!--                                                                        <span class="form-radio-sign">禁用</span>-->
<!--                                                                    </label>-->
<!--                                                                </div>-->
<!--                                                            </div>-->
<!--                                                        </div>-->
                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="company" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">公司</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full company" id="company" name="company" placeholder="公司">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="remark" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">备注</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <textarea id="remark" name="remark" class="form-control input-full" style="height: 200px!important"></textarea>
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="remark" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">开启子商户</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="checkbox" name="is_sub_mer" lay-skin="switch" lay-text="ON|OFF">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="remark" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">开启线索短信</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="checkbox" checked="" name="is_send_phone" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <input type="hidden" id="id" name="id" value="">
                                                        <button type="submit" id="addRowButton" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>


                                <div class="modal fade" id="addRowModal10" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">添加</span>

                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal10">
                                                    <div class="row">


                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="company" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">公司</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full company" name="company" placeholder="公司">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="remark" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">备注</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <textarea id="remark2" name="remark" class="form-control input-full" style="height: 300px!important"></textarea>
                                                            </div>
                                                        </div>


                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <input type="hidden" id="markid" name="id" value="">
                                                        <button type="submit" id="addRowButton10" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>



                                <!-- Modal2 -->
                                <div class="modal fade" id="addRowModal2" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">定时投放</span>
                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal2">
                                                    <div class="row">

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="start_time" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">开始时间 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="start_time" name="start_time" autocomplete="off" placeholder="开始时间">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="end_time" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">结束时间</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="end_time" name="end_time" autocomplete="off" placeholder="结束时间">
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <input type="hidden" id="id2" name="id" value="">
                                                        <button type="submit" id="addRowButton2" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>



<!--                                单个-->
                                <div class="modal fade" id="addRowModal5" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">投放时段</span>
                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal5">
                                                    <div class="row">


                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="wday" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">选择星期 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <select class="form-control input-full" name="wday[]" id="wday" multiple="multiple">
                                                                    <option value="1">星期一</option>
                                                                    <option value="2">星期二</option>
                                                                    <option value="3">星期三</option>
                                                                    <option value="4">星期四</option>
                                                                    <option value="5">星期五</option>
                                                                    <option value="6">星期六</option>
                                                                    <option value="0">星期日</option>
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="timeday" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">选择时段 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="layui-input" id="test9" name="timeday" placeholder=" - ">
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <input type="hidden" id="id5" name="id" value="">
                                                        <button type="submit" id="addRowButton5" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>


                                <!-- Modal3 -->
                                <div class="modal fade" id="addRowModal3" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content" style="width: 1000px">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">接收设置</span>
                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal3">
                                                    <div class="row">

                                                        <div class="col-md-12">
                                                            <div class="card">

                                                                <div class="card-body">

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-6">
                                                                            <div class="form-group">
                                                                                <label>系统名称</label>
                                                                                <input type="text" class="form-control" name="api_name">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-6">
                                                                            <div class="form-group">
                                                                                <label>api地址</label>
                                                                                <input type="text" class="form-control" name="api_url">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-6">
                                                                            <div class="form-group">
                                                                                <label>api_key</label>
                                                                                <input type="text" class="form-control" name="api_key" placeholder="单独推送需填写">
                                                                            </div>
                                                                        </div>
                                                                    </div>


                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <label>我方字段</label>
                                                                                <input type="text" class="form-control" value="clue_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <label>我方描述</label>
                                                                                <input type="text" class="form-control" value="线索名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <label>对方字段（选填）</label>
                                                                                <input type="text" class="form-control" name="clue_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <label>对方描述</label>
                                                                                <input type="text" class="form-control" name="clue_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>


                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="clue_id" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="线索ID" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="clue_id">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="clue_id*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="clue_type" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="线索类型" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="clue_type">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="clue_type*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="age" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="年龄" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="age">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="age*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="phone" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="手机号" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="phone">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="phone*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="wechat" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="微信号" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="wechat">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="wechat*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="qq" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="QQ号" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="qq">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="qq*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="gender" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="性别" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="gender">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="gender*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="city" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="城市" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="city">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="city*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="email" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="邮箱" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="email">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="email*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>


                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="source" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="线索来源" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="source">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="source*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="site_url" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="站点url" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="site_url">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="site_url*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="page_id" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="页面id" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="page_id">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="page_id*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="page_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="页面名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="page_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="page_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="campaign_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="广告计划名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="campaign_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="campaign_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="adgroup_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="广告组名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="adgroup_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="adgroup_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="unit_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="广告单元名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="unit_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="unit_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="creative_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="广告创意名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="creative_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="creative_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>


                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="ad_name" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="广告名称" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="ad_name">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="ad_name*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="search_term" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="搜索词" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="search_term">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="search_term*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="keyword" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="关键词" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="keyword">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="keyword*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="clue_local" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="线索地域" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="clue_local">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="clue_local*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="ip" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="线索IP" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="ip">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="ip*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="house" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="房" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="house">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="house*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="car" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="车" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="car">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="car*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="loan_limit" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="贷款额度" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="loan_limit">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="loan_limit*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="apply_limit" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="申请额度" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="apply_limit">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="apply_limit*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="public_funds" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="公积金" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="public_funds">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="public_funds*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="company" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="公司" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="company">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="company*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <div class="row">
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="remark" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" value="备注" disabled>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="remark">
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-md-6 col-lg-3">
                                                                            <div class="form-group">
                                                                                <input type="text" class="form-control" name="remark*mapping">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                </div>
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <input type="hidden" id="mer_id" name="mer_id" value="">
                                                        <button type="submit" id="addRowButton3" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>


                                <!-- Modal4 -->
                                <div class="modal fade" id="addRowModal4" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">定时投放</span>
                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal4">
                                                    <div class="row">

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="start_time" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">开始时间 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="start_time2" name="start_time" autocomplete="off" placeholder="开始时间">
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="end_time" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">结束时间</font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="form-control input-full" id="end_time2" name="end_time" autocomplete="off" placeholder="结束时间">
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <button type="submit" id="addRowButton4" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>


                                <div class="modal fade" id="addRowModal6" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header no-bd">
                                                <h5 class="modal-title">
                                                    <span class="fw-mediumbold">定时投放</span>
                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <form id="form-modal6">
                                                    <div class="row">


                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="wday" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">选择星期 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <select class="form-control input-full" name="wday[]" id="wday2" multiple="multiple">
                                                                    <option value="1">星期一</option>
                                                                    <option value="2">星期二</option>
                                                                    <option value="3">星期三</option>
                                                                    <option value="4">星期四</option>
                                                                    <option value="5">星期五</option>
                                                                    <option value="6">星期六</option>
                                                                    <option value="0">星期日</option>
                                                                </select>
                                                            </div>
                                                        </div>

                                                        <div class="form-group form-inline col-md-12">
                                                            <label for="timeday" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">选择时段 <b class="required_b">*</b> </font></label>
                                                            <div class="col-md-8 p-0">
                                                                <input type="text" class="layui-input" id="test10" name="timeday" placeholder=" - ">
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="modal-footer no-bd">
                                                        <button type="submit" id="addRowButton6" class="btn btn-primary">保存</button>
                                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                                    </div>
                                                </form>
                                            </div>

                                        </div>
                                    </div>
                                </div>


                                <div class="table-responsive">
                                    <table id="add-row" class="display table table-striped table-hover" >
                                        <thead>
                                        <tr>
                                            <th><input type="checkbox" class="check">全选</th>
                                            <th>ID</th>
                                            <th>账号</th>
                                            <th>商户名称</th>
                                            <th>商户简称</th>
                                            <th>余额</th>
                                            <th>公司</th>
                                            <th>电话</th>
                                            <th>绑定人员</th>
                                            <th>时间</th>
                                            <th>是否启用</th>
<!--                                            <th>定时投放</th>-->
                                            <th>备注</th>
                                            {if condition="!in_array($group_id,[4,5])"}
                                            <th style="width: 10%">操作</th>
                                            {/if}
                                        </tr>
                                        </thead>

                                        <tbody>

                                        {volist name="infos" id="vo"}
                                        <tr>
                                            <td><input type="checkbox" class="check" value="{$vo.id}" name="idcheckbox"></td>
                                            <td>{$vo.id}</td>
                                            <td>{$vo.username}</td>
                                            <td>{$vo.mer_name}</td>
                                            <td>{$vo.mer_desc}</td>
                                            <td>
                                                <a href="{:url('merchant/moneyLog',['mer_id'=>$vo.id,'type'=>1])}">账户币：{$vo.balance}</a><br>
                                                <a href="{:url('merchant/moneyLog',['mer_id'=>$vo.id,'type'=>2])}">真实币：{$vo.balance2}</a><br>
                                                <a href="{:url('merchant/moneyLog',['mer_id'=>$vo.id,'type'=>3])}">服务币：{$vo.balance3}</a>

                                            </td>
                                            <td>{$vo.company}</td>
                                            <td>{$vo.phone}
                                                {if condition="!in_array($group_id,[4,5])"}
                                                <br>
                                                <button type="button" data-toggle="tooltip" title="" onClick="send_phone(this,'{$vo.id}')" class="layui-btn layui-btn-xs" data-original-title="短信重发">
                                                    短信重发
                                                </button>
                                                {/if}

                                            </td>
                                            <td>引入人：{$vo.yingru}<br>
                                                维护人：{$vo.weihu}
                                            </td>
                                            <td>创建时间：{$vo.create_time}<br>
                                                修改时间：{$vo.update_time}
                                            </td>
                                            <td>{$vo.status|getStatus}</td>
<!--                                            <td>时间：{$vo.timing}-->
<!--                                                {if condition="!in_array($group_id,[4,5])"}-->
<!--                                                <button type="button" title="编辑时间" class="btn btn-link btn-primary btn-lg" data-toggle="modal" data-target="#addRowModal2" onClick="edit_timing('{$vo.id}')">-->
<!--                                                    <i class="fas fa-calendar-alt"></i>-->
<!--                                                </button>-->
<!--                                                <br>-->
<!--                                                {/if}-->

<!--                                                周：{$vo.weekStr}<br>-->
<!--                                                时段：{$vo.timeday}-->
<!--                                                {if condition="!in_array($group_id,[4,5])"}-->
<!--                                                <button type="button" title="编辑时段" class="btn btn-link btn-primary btn-lg" data-toggle="modal" data-target="#addRowModal5" onClick="edit_daytime('{$vo.id}')">-->
<!--                                                    <i class="fas fa-calendar-alt"></i>-->
<!--                                                </button>-->
<!--                                                {/if}-->
<!--                                            </td>-->
                                            <td>{$vo.remark}</td>
                                            {if condition="!in_array($group_id,[4,5])"}
                                            <td>
                                                <div class="form-button-action">


                                                    {if condition="$vo.status eq 1"}

                                                    <button type="button" data-toggle="tooltip" title="" onClick="admin_stop(this,'{$vo.id}')" class="btn btn-link btn-warning" data-original-title="停用">
                                                        <i class="fa fa-toggle-on"></i>停用
                                                    </button>


                                                    {else/}

                                                    <button type="button" data-toggle="tooltip" title="" onClick="admin_start(this,'{$vo.id}')" class="btn btn-link btn-success" data-original-title="启用">
                                                        <i class="fa fa-toggle-off"></i>启用
                                                    </button>
                                                    {/if}

                                                    <button type="button" title="编辑" class="btn btn-link btn-primary btn-lg" data-toggle="modal" data-target="#addRowModal" onClick="edit_item('{$vo.id}')">
                                                        <i class="fa fa-edit"></i>编辑
                                                    </button>

                                                    <button type="button" data-toggle="tooltip" onClick="admin_del(this,'{$vo.id}')" title="" class="btn btn-link btn-danger" data-original-title="删除">
                                                        <i class="fa fa-times"></i>删除
                                                    </button>

                                                    <button type="button" title="接收设置" class="btn btn-link btn-info btn-lg" data-toggle="modal" data-target="#addRowModal3" onClick="edit_mapping('{$vo.id}')">
                                                        <i class="fas fa-cog"></i>接收设置
                                                    </button>
                                                </div>



                                            </td>
                                            {else /}


                                            <td>
                                                <div class="form-button-action">


                                                    <button type="button" title="编辑" class="btn btn-link btn-primary btn-lg" data-toggle="modal" data-target="#addRowModal10" onClick="edit_item('{$vo.id}')">
                                                        <i class="fa fa-edit"></i>编辑
                                                    </button>
                                                </div>



                                            </td>

                                            {/if}
                                        </tr>
                                        {/volist}

                                        </tbody>
                                    </table>

                                    <!-- 分页 (调取通用方法)-->
                                    <div class="layui-box layui-laypage layui-laypage-molv">{:pagination($infos)}</div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>

        {include file="public/_footer" /}


    </div>



</div>

{include file="public/_js" /}

</body>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    var SCOPE = {
        'status_url':"{:url('merchant/status')}",
        'bstatus_url':"{:url('merchant/batchstatus')}",
        'delete_url':"{:url('merchant/delete')}",
        'item_url':"{:url('merchant/edit')}",
        // 'edit_daytime':"{:url('merchant/edit_daytime')}",
        'item_mapping_url':"{:url('merchant/edit_mapping')}",
        'add_url':"{:url('merchant/save')}",
        'add_remark':"{:url('merchant/saveRemark')}",
        'add_timing_url':"{:url('merchant/save_timing')}",
        'add_timing_url2':"{:url('merchant/save_timing2')}",
        'add_timeday':"{:url('merchant/save_timeday')}",
        'add_timeday2':"{:url('merchant/save_timeday2')}",
        'add_mapping_url':"{:url('merchant/save_mapping')}",
        'clue_url':"{:url('merchant/clue_url')}",
        'send_phone':"{:url('merchant/sendSmsPhone')}",
    };


    $(function(){
        var commitStatus = false;
        /*表单验证*/
        $("#form-modal").validate({
            rules:{
                mer_name:{
                    required:true,
                    maxlength:30
                },
                mer_desc:{
                    maxlength:30
                },
                contacts:{
                    maxlength:10
                },
                phone:{
                    number:true,
                    minlength:11,
                    maxlength:11
                },
                email:{
                    email:true,
                    maxlength:100
                },
                web_url:{
                    url:true,
                    maxlength:100
                },
                unify_code:{
                    maxlength:50
                },
                address:{
                    maxlength:100
                }

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_url;
                if(commitStatus==true){
                    return false;
                }
                var channel_id = $("#channel_id").val();
                if(channel_id == 0){
                    layer.msg('请选择媒体',{icon:2,time:2000});return false;
                }
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

        $("#form-modal10").validate({
            rules:{

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_remark;
                if(commitStatus==true){
                    return false;
                }

                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

        $("#form-modal2").validate({
            rules:{
                start_time:{
                    required:true
                },
                end_time:{
                    required:true
                }

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_timing_url;
                if(commitStatus==true){
                    return false;
                }
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

        $("#form-modal3").validate({
            // rules:{
            //     api_name:{
            //         required:true
            //     },
            //     api_url:{
            //         required:true
            //     }
            //
            // },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_mapping_url;
                if(commitStatus==true){
                    return false;
                }
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

        $("#form-modal4").validate({
            rules:{
                start_time2:{
                    required:true
                },
                end_time2:{
                    required:true
                }

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_timing_url2;
                if(commitStatus==true){
                    return false;
                }
                var chk_value =[];
                $('input[name="idcheckbox"]:checked').each(function(){ //遍历，将所有选中的值放到数组中
                    chk_value.push($(this).val());
                });
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    data:{id:chk_value},
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

        $("#form-modal6").validate({
            rules:{

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_timeday2;
                if(commitStatus==true){
                    return false;
                }
                var chk_value =[];
                $('input[name="idcheckbox"]:checked').each(function(){ //遍历，将所有选中的值放到数组中
                    chk_value.push($(this).val());
                });
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    data:{id:chk_value},
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

        $("#form-modal5").validate({
            rules:{
                // start_time2:{
                //     required:true
                // },
                // end_time2:{
                //     required:true
                // }

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_timeday;
                if(commitStatus==true){
                    return false;
                }

                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });
    });

    function change_status(status){

        if (status == 1) {
            var msg = '确认要开启吗';
        } else if (status == 2) {
            var msg = '确认要停用吗';
        }
        layer.confirm(msg,function(index){
            //此处请求后台程序，下方是成功后的前台处理……
            var url = SCOPE.bstatus_url;


            var chk_value =[];
            $('input[name="idcheckbox"]:checked').each(function(){ //遍历，将所有选中的值放到数组中
                chk_value.push($(this).val());
            });
            var loading = layer.load('加载中...', {
                shade: [0.3,'#fff'] //0.1透明度的白色背景
            });

            $.post(url,{status:status,id:chk_value},function(data){
                layer.close(loading);
                if(data.code == 1001){
                    layer.msg('设置成功',{icon: 1,time:1000},function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(data.msg,{icon: 2,time:1000});
                }

            });


        });


    };

    function add_item(id) {
        $("input[name='id']").val(id);
        document.getElementById('form-modal').reset();
        $(".fw-mediumbold").text('添加');
    }

    function edit_item(id) {
        $("#system_div").hide();
        $.ajax({
            type: 'GET',
            url: SCOPE.item_url,
            dataType: 'json',
            data: {id:id},
            success: function(res){
                if(res.code == 1001){
                    $(".fw-mediumbold").text('编辑');
                    $("#id").val(res.data.id);
                    $("#markid").val(res.data.id);
                    $("#username").val(res.data.username);
                    $("#password").val(res.data.password);
                    $("#mer_name").val(res.data.mer_name);
                    $("#mer_desc").val(res.data.mer_desc);
                    $("#contacts").val(res.data.contacts);
                    $("#phone").val(res.data.phone);
                    $("#email").val(res.data.email);
                    $("#web_url").val(res.data.web_url);
                    $("#unify_code").val(res.data.unify_code);
                    $("#address").val(res.data.address);
                    $(".company").val(res.data.company);
                    $("#remark").val(res.data.remark);
                    $("#remark2").val(res.data.remark);
                    // $("#bind_user").val(res.data.bind_user);
                    // $("#weihu_user").val(res.data.weihu_user);
                    $("#bind_aid").val(res.data.bind_aid);
                    $("#weihu_aid").val(res.data.weihu_aid);
                    if(res.data.is_sub_mer == 1){
                        $("[name='is_sub_mer']").prop("checked",true);
                    }else{
                        $("[name='is_sub_mer']").prop("checked",false);
                    }
                    if(res.data.is_send_phone == 1){
                        $("[name='is_send_phone']").prop("checked",true);
                    }else{
                        $("[name='is_send_phone']").prop("checked",false);
                    }
                    // $("#bind_user").attr("disabled","disabled");
                    // $(":radio[name='status'][value='"+res.data.status+"']").prop("checked","checked");
                }else{
                    layer.msg(res.msg,{icon:2,time:2000});
                }

            },
            error:function(res) {
                layer.msg('网络错误,稍后再试...',{icon:2,time:2000});
            }
        });
    }

    function edit_mapping(id) {
        $("input[name='mer_id']").val(id);
        document.getElementById('form-modal3').reset();
        $.ajax({
            type: 'GET',
            url: SCOPE.item_mapping_url,
            dataType: 'json',
            data: {mer_id:id},
            success: function(res){
                if(res.code == 1001){
                    $("input[name='api_name']").val(res.data.api_name);
                    $("input[name='api_url']").val(res.data.api_url);
                    $("input[name='api_key']").val(res.data.api_key);
                    $.each(res.data.rules, function (index, value){
                        $("input[name='"+value.orig+"']").val(value.curr);
                        $("input[name='"+value.orig+"*mapping']").val(value.describe);
                    })
                }else if(res.code == 1000){

                }else{
                    layer.msg(res.msg,{icon:2,time:2000});
                }

            },
            error:function(res) {
                layer.msg('网络错误,稍后再试...',{icon:2,time:2000});
            }
        });
    }


    function edit_timing(id) {
        $.ajax({
            type: 'GET',
            url: SCOPE.item_url,
            dataType: 'json',
            data: {id:id},
            success: function(res){
                if(res.code == 1001){
                    $("#id2").val(res.data.id);
                    $("#start_time").val(res.data.start_time);
                    $("#end_time").val(res.data.end_time);
                }else{
                    layer.msg(res.msg,{icon:2,time:2000});
                }

            },
            error:function(res) {
                layer.msg('网络错误,稍后再试...',{icon:2,time:2000});
            }
        });
    }

    function edit_daytime(id) {
        $("#wday").val('');
        $("#wday").multipleSelect('refresh');
        $.ajax({
            type: 'GET',
            url: SCOPE.item_url,
            dataType: 'json',
            data: {id:id},
            success: function(res){
                if(res.code == 1001){
                    $("#id5").val(res.data.id);
                    $("#test9").val(res.data.timeday);

                    var sceneIdList =res.data.weekday.toString() ;


                    sceneIdArr = sceneIdList.split(",");


                    $('#wday option').each(function (i, content) {

                        if ($.inArray($.trim(content.value), sceneIdArr) >= 0) {

                            this.selected = true;

                        }else{
                            this.selected = false;
                        }

                    });
                    //加载完勾选项后也要刷新
                    $("#wday").multipleSelect('refresh');

                }else{
                    layer.msg(res.msg,{icon:2,time:2000});
                }

            },
            error:function(res) {
                layer.msg('网络错误,稍后再试...',{icon:2,time:2000});
            }
        });
    }



    /*删除*/
    function admin_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: SCOPE.delete_url,
                dataType: 'json',
                data: {id:id},
                success: function(data){
                    if(data.code == 1001){
                        $(obj).parents("tr").remove();
                        layer.msg('删除商户成功!',{icon:1,time:2000});
                    }else{
                        layer.msg(data.msg,{icon:2,time:2000});
                    }

                },
                error:function(data) {
                    layer.msg('网络错误,稍后再试...',{icon:2,time:2000});
                }
            });
        });
    }


    /*机构-停用*/
    function admin_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……
            var url = SCOPE.status_url;
            $.post(url,{status:2,id:id},function(data){
                if(data.code == 1001){
                    layer.msg('已停用!',{icon: 1,time:1000},function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(data.msg,{icon: 2,time:1000});
                }

            });


        });
    }

    /*机构-启用*/
    function admin_start(obj,id){
        layer.confirm('确认要启用吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……

            var url = SCOPE.status_url;
            $.post(url,{status:1,id:id},function(data){
                if(data.code == 1001){

                    layer.msg('已启用!',{icon: 1,time:1000},function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(data.msg,{icon: 2,time:1000});
                }
            });
        });
    }

    /*短信重发*/
    function send_phone(obj,id){
        layer.confirm('确认要发送吗？',function(index){

            var loading = layer.load(0, {
                shade: true,
                time: 10*1000
            });

            //此处请求后台程序，下方是成功后的前台处理……
            var url = SCOPE.send_phone;
            $.post(url,{status:2,id:id},function(data){
                if(data.code == 1001){
                    layer.msg(data.msg,{icon: 1,time:1000},function(){
                        layer.close(loading);
                        window.location.reload();
                    });
                }else{
                    layer.close(loading);
                    layer.msg(data.msg,{icon: 2,time:2000});
                }

            });


        });
    }

    laydate.render({
        elem: '#start_time'
        ,type: 'datetime'
    });
    laydate.render({
        elem: '#end_time'
        ,type: 'datetime'
    });

    laydate.render({
        elem: '#start_time2'
        ,type: 'datetime'
    });
    laydate.render({
        elem: '#end_time2'
        ,type: 'datetime'
    });

    //时间范围
    laydate.render({
        elem: '#test9'
        ,type: 'time'
        ,range: true
    });

    laydate.render({
        elem: '#test10'
        ,type: 'time'
        ,range: true
    });

    function getCheckBoxVal(){ //jquery获取所有选中的复选框的值
        var chk_value =[];
        $('input[name="idcheckbox"]:checked').each(function(){ //遍历，将所有选中的值放到数组中
            chk_value.push($(this).val());
        });
    }

</script>

<link rel="stylesheet" href="__STATIC__/multiple-select-1.6.0/dist/multiple-select.css">

<!-- Latest compiled and minified JavaScript -->
<script src="__STATIC__/multiple-select-1.6.0/dist/multiple-select.js"></script>
<script>
    $('#wday').multipleSelect({
        selectAll:false//是否有全选按钮

    });
    $('#wday2').multipleSelect({
        selectAll:false//是否有全选按钮

    });

</script>


</html>




























